package com.aixin.csopservice.controller;


import com.aixin.common.utils.StringUtils;
import com.aixin.csopservice.model.*;
import com.aixin.csopservice.service.PointService;
import com.aixin.csopservice.utils.RSA2Util;
import com.aixin.csopservice.utils.Util;
import com.aixin.csopuser.domain.CustomerDomain;
import com.aixin.csopuser.model.CustomerModel;
import com.aixin.csopuser.service.YjkApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("/point")
@EnableAutoConfiguration
public class PointController {

    @Autowired
    private PointService pointService;



    @RequestMapping(value ="/getCustomerID")
    public CustomerPointModel getCustomerID(@RequestBody CustomerModel customerModel){


        return pointService.getCustomerID(customerModel);
    }

    @RequestMapping(value ="/getPoint")
    public ReturnPoint getPoint(@RequestBody CustomerPointModel customerPointModel){
        return pointService.getPoint(customerPointModel);
    }

    @RequestMapping(value ="/placeAnOrder")
    public ReturnPointMessage placeAnOrder(@RequestBody PlaceAnOrderModel placeAnOrderModel){
        return pointService.placeAnOrder(placeAnOrderModel);
    }

    @RequestMapping(value ="/chargeback")
    public ReturnChargebackModel chargeback(@RequestBody ChargebackModel chargebackModel){
        return pointService.chargeback(chargebackModel);
    }
}
